﻿using System;
using System.Collections.Generic;
using Model;
namespace BLL
{
    #region class Barea
    /// <summary>
    /// Interface:area Interface
    /// Author:wxc
    /// DateTime:2021/5/29 14:19:22
    /// </summary>	
    public class Barea
    {
        #region Add Method
        /// <summary>
        /// Insert an item
        /// </summary>
        /// <param name="area"></param>
        /// <returns>count of rows affected</returns>
        public int Addarea(areaEntity area)
        {
            DAL.DALarea dal = new DAL.DALarea();
            return dal.Addarea(area);
        }
        #endregion
        #region Mod Method
        /// <summary>
        /// Update an item
        /// </summary>
        /// <param name="area"></param>
        /// <returns>count of rows affected</returns>
        public int Modarea(areaEntity area)
        {
            DAL.DALarea dal = new DAL.DALarea();
            return dal.Modarea(area);
        }
        #endregion
        #region Del Method
        /// <summary>
        /// Del an item by primary key
        /// </summary>
        /// <param name="id"></param> 
        /// <returns>count of rows affected</returns>
        public int Delarea(int id)
        {
            DAL.DALarea dal = new DAL.DALarea();
            return dal.Delarea(id);
        }
        #endregion
        #region Select Method
        /// <summary>
        /// Select an item by Primarykey
        /// </summary>
        /// <param name="id"></param>
        /// <returns>an item</returns>
        public areaEntity Getarea(int id)
        {
            DAL.DALarea dal = new DAL.DALarea();
            return dal.Getarea(id);
        }
        #endregion
        #region Select_All Method
        /// <summary>
        /// Select all items
        /// </summary>
        /// <returns>items</returns>
        public IList<areaEntity> Getareas()
        {
            DAL.DALarea dal = new DAL.DALarea();
            return dal.Getareas();
        }
        #endregion
        #region public common select by conditions ,we can use it by changing the GetareasbyCondition(datatype condition) and sql
        /// <summary>
        /// Select items by Columns
        /// </summary>
        /// <param name="columns name"></param>
        /// <returns>items</returns>
        public IList<areaEntity> GetareasbyCondition(string sql)
        {
            DAL.DALarea dal = new DAL.DALarea();
            return dal.GetareasbyCondition(sql);
        }
        #endregion
        #region Select items Top n
        /// <summary>
        /// Select items by Columns
        /// </summary>
        /// <param name="columns name"></param>
        /// <returns>items</returns>
        public IList<areaEntity> GetareasTopN(int n)
        {
            DAL.DALarea dal = new DAL.DALarea();
            return dal.GetareasTopN(n);
        }
        #endregion
    }
    #endregion
}
